Skip to content

Conversation

@35C4n0r
Copy link
Collaborator

@35C4n0r 35C4n0r commented Jan 13, 2026

Description

  • Add support for AI Bridge

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/claude-code
New version: v4.5.0
Breaking change: [ ] Yes [ ] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

Closes: #649

@35C4n0r 35C4n0r marked this pull request as draft January 13, 2026 10:40
@35C4n0r 35C4n0r self-assigned this Jan 13, 2026
@35C4n0r
Copy link
Collaborator Author

35C4n0r commented Jan 13, 2026

wip.

For AI Bridge configuration set `enable_coder_aibridge` to `true`. [AI Bridge](https://coder.com/docs/ai-coder/ai-bridge) is a Premium Coder feature that provides centralized LLM proxy management.

```tf
resource "coder_ai_task" "task" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't think we should provide the default example to be through tasks.

Not all users want it for tasks only.

So my suggestion is to either have two examples

  1. With tasks
  2. Standalone where we just install and configure Claude CLI.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, but looks good. Also, what do you think about moving the AI Bridge example a bit higher before Bedrock and Vertex AI examples?

@35C4n0r 35C4n0r marked this pull request as ready for review January 15, 2026 06:08
Comment on lines +178 to +181
# Add API key only if set
if [ -n "${CLAUDE_API_KEY:-}" ]; then
jq --arg apikey "${CLAUDE_API_KEY}" '.primaryApiKey = $apikey' "$claude_config" > "${claude_config}.tmp" && mv "${claude_config}.tmp" "$claude_config"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we get any benefit from adding the key to the file? Why not only rely on coder_env and set it as ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to do this as well. Since this is the best way to ensure its set for claude-code globally in the environment. I moved the model to a coder env in the previous update as well.


validation {
condition = !(var.enable_aibridge && length(var.claude_api_key) > 0)
error_message = "claude_api_key cannot be provided when enable_aibridge is true. AI Bridge uses Coder's authentication."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error_message = "claude_api_key cannot be provided when enable_aibridge is true. AI Bridge uses Coder's authentication."
error_message = "claude_api_key cannot be provided when enable_aibridge is true. AI Bridge automatically authenticates the client using their Coder credentials."

What do you think about something like this?

Same suggestion below.

@DevelopmentCats
Copy link
Contributor

@35C4n0r other than what atif mentioned this looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add AI Bridge Integration to Claude Code Module

4 participants